<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:DentalGUIHelper;assembly=DentalConfig"
    xmlns:local="clr-namespace:DentalConfig;assembly=DentalConfig">
  <!--PlainView Default Style for ListView-->

  <Style x:Key="ButtonFocusVisual">
    <Setter Property="Control.Template">
      <Setter.Value>
        <ControlTemplate>
          <Rectangle Margin="4"
                     StrokeThickness="1"
                     Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
                     StrokeDashArray="1 2"
                     SnapsToDevicePixels="true"/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>


  <Style TargetType="{x:Type s:SplitButton}">
    <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}" />
    <Setter Property="SnapsToDevicePixels" Value="true" />
    <Setter Property="Foreground" Value="#FFFFFF"/>
    <Setter Property="Background" Value="{DynamicResource ButtonBrush}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource ButtonBrush}"/>
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="FontSize" Value="13" />
    <Setter Property="FontFamily" Value="{DynamicResource ButtonFontFamily}" />
    <Setter Property="VerticalContentAlignment" Value="Center" />
    <Setter Property="HorizontalContentAlignment" Value="Center" />
    <Setter Property="Padding" Value="5" />
    <Setter Property="Template">
      <Setter.Value>
        <!-- SplitButton Template -->
        <ControlTemplate TargetType="{x:Type s:SplitButton}">
          <Grid>
            <Grid Background="{TemplateBinding Background}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="16"/>
              </Grid.ColumnDefinitions>

              <Border Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                <ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True"/>
              </Border>

              <Path x:Name="path" Data="M0,0L3,3 6,0z" Margin="4,1,0,-1" Grid.Column="1" Stroke="{TemplateBinding Foreground}"  Fill="{TemplateBinding Foreground}"  HorizontalAlignment="Center" VerticalAlignment="Center" />

              <Button x:Name="PART_DropDown"   Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}" IsDefault="{TemplateBinding IsDefault}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="1" Margin="0,-2,-2,-2"  Opacity="0">

                <Path Data="M0,0L3,3 6,0z" Margin="2,1,0,-1" Stroke="{TemplateBinding Foreground}" Fill="{TemplateBinding Foreground}" />
              </Button>

            </Grid>
          </Grid>
          <ControlTemplate.Triggers>
            <Trigger Property="Mode" Value="Dropdown">
              <Setter Property="Visibility" TargetName="PART_DropDown" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="Mode" Value="Button">
              <Setter Property="Visibility" TargetName="PART_DropDown" Value="Collapsed"/>
              <Setter Property="Visibility" TargetName="path" Value="Collapsed"/>
              <Setter Property="Grid.ColumnSpan" TargetName="Bd" Value="2"/>
            </Trigger>
            <Trigger Property="IsMouseOver" SourceName="PART_DropDown" Value="true">
              <Setter Property="Opacity" TargetName="PART_DropDown" Value="1"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
              <Setter Property="Background" Value="{DynamicResource ButtonBrushMouseOver}"/>
            </Trigger>
            <Trigger Property="IsPressed" Value="true">
              <Setter Property="Background" Value="{DynamicResource ButtonPressedBackground}"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
              <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}"/>
              <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
            </Trigger>

          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Style.Triggers>
    </Style.Triggers>
  </Style>
</ResourceDictionary>
